<template>
  <div>
    <h2>{{ count }}</h2>
   
  </div>
</template>

<script>
export default {
  name: "CountOne",
  data() {
    return {
      count: 0,
    };
  },
  //订阅方
  mounted() {
    this.$bus.$on("count", (count) => {
      this.count = count;
    });
  },
};
</script>

<style scoped>
div {
  background-color: #3cf;
}
</style>